<template>
  <el-dialog title="修改分类信息"
             :visible.sync="visible"
             @close="handleCancelEdit">
    <el-form ref="updateTemp" :model="updateTemp">
      <!--<el-form-item label="发布时间" prop="time">-->
        <!--&lt;!&ndash;<el-input v-model="updateTemp.publishedAt" type="text">&ndash;&gt;-->
        <!--&lt;!&ndash;</el-input>&ndash;&gt;-->
        <!--<el-date-picker-->
          <!--v-model="updateTemp.publishedAt"-->
          <!--type="datetime"-->
          <!--format="yyyy-MM-dd HH:mm"-->
          <!--placeholder="选择日期时间">-->
        <!--</el-date-picker>-->
      <!--</el-form-item>-->
      <el-form-item label="分类名称" prop="name">
        <el-input v-model="updateTemp.name" type="text" >
        </el-input>
      </el-form-item>

    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleCancelEdit">取消</el-button>
      <el-button type="primary" @click="handleUpdateData">确定</el-button>
    </div>
  </el-dialog>
</template>

<script>
  // import Tinymce from '@/components/Tinymce'

  export default {
    name: 'update-dialog',
    components: {
    },
    data() {
      return {
        visible: false,
        dialogVisible: false
      }
    },
    props: {
      updateTemp: Object,
      dialogUpdateFormVisible: Boolean
    },
    watch: {
      dialogUpdateFormVisible(val) {
        this.visible = val
      }
    },
    methods: {
      handleCancelEdit() {
        this.visible = false
        this.$emit('cancel', this.visible)
      },
      handleUpdateData() {
        // console.log(this.$refs.upload.fileList)
        this.$emit('update')
          // this.$refs.upload.clearFiles()
      }
    }
  }
</script>

<style scoped>

</style>
